GDK W32: Set default cursor from our own theme right away
authorРуслан Ижбулатов <lrn1986@gmail.com>
Tue, 1 Mar 2016 03:40:36 +0000 (03:40 +0000)
committerРуслан Ижбулатов <lrn1986@gmail.com>
Thu, 3 Mar 2016 07:20:02 +0000 (07:20 +0000)
Otherwise WM-dependent default cursor is used, which does not
match our theme. Worse, later GDK will realize that we have
our own left_ptr cursor and will apply it after all, making
the discrepancy even more noticeable.

https://bugzilla.gnome.org/show_bug.cgi?id=762902

gdk/win32/gdkwindow-win32.c

index 09db5d6d2d16bff1c01a135001b4d0c04e8857c8..c84ceb89860f843b729eedf0e10444d65dac99ba 100644 (file)
@@ -138,6 +138,8 @@ _gdk_window_impl_win32_get_type (void)
 static void
 gdk_window_impl_win32_init (GdkWindowImplWin32 *impl)
 {
+  GdkDisplay *display = gdk_display_get_default ();
+
   impl->toplevel_window_type = -1;
   impl->cursor = NULL;
   impl->hicon_big = NULL;
@@ -148,6 +150,14 @@ gdk_window_impl_win32_init (GdkWindowImplWin32 *impl)
   impl->transient_children = NULL;
   impl->num_transients = 0;
   impl->changing_state = FALSE;
+
+  if (display != NULL)
+    /* Replace WM-defined default cursor with the default cursor
+     * from our theme. Otherwise newly-opened windows (such as popup
+     * menus of all kinds) will have WM-default cursor when they are
+     * first shown, which will be replaced by our cursor only later on.
+     */
+    impl->cursor = _gdk_win32_display_get_cursor_for_type (display, GDK_LEFT_PTR);
 }
 
 static void